# import torch
# cross_attn = torch.nn.MultiheadAttention(256, 1)


# q=torch.ones(10,20,256)
# k=torch.ones(100,20,256)
# v=torch.ones(100,20,256)

# out,attn=cross_attn(q,k,v)

# print(out.shape)

# # for parameters in cross_attn.parameters():
# #     print(parameters)

# for name,parameters in cross_attn.named_parameters():
#     print(name,':',parameters.size())

# import numpy as np

# mel_path="/home/wang/codes/py/VC/VCTK/data_wav2ec/train/mels/p225/p225_001_mic1.npy"
# data=np.load(mel_path)
# print(data.shape)

# wav2vec_path="/home/wang/codes/py/VC/VCTK/data_wav2ec/train/wav2vec/p225/p225_001_mic1.npy"
# wav2vec=np.load(wav2vec_path)
# print(wav2vec.shape)

# import numpy as np
# a=[]
# a.append([1,2])
# a.append([3,2])
# b=np.concatenate(a, 0)
# print(b.shape)

# status=np.load("/home/wang/codes/py/VC/VCTK/mel_stats/stats.npy")
# print(status.shape)


# from pesq import pesq
# import soundfile as sf
# clean_path="/home/wang/codes/py/VC/VQMIVC/test_wav/mic_F01_si453.wav"
# clean, fs = sf.read(clean_path, dtype="float32")
# estimate, fs = sf.read(clean_path, dtype="float32")
# pesq_wb = pesq(16000,ref=clean, deg=estimate, mode="wb")
# print(pesq_wb)


# import os
# path="/home/wang/codes/py/VC/select_AIshell/data/train/mels"
# batch=os.listdir(path)
# print(len(batch))

# import numpy as np

# data=np.array([[1,2],[2,2],[3,4]])

# d=np.array([1,2,3]).reshape(-1,1)



# print(data-d)

# a=[1,2,3,4]
# print(a[-2:])
# print(a[:-2])
from omegaconf import DictConfig, OmegaConf,open_dict
import fairseq

# 加载Hubert
# ckpt_path = "/opt/data/private/VC/model_checkpoints/hubert_large_ll60k.pt"
# models, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([ckpt_path])
# Hubert_model = models[0]
# Hubert_model.remove_pretraining_modules()
# Hubert_model.eval()

# config_path="config/Hubert_train.yaml"
# cfg = OmegaConf.load(config_path)

# print(cfg.training.scheduler.initial_lr)

import numpy as np

path="/opt/data/private/VC/VCTK/Speaker_embedding/p225/p225_001_mic1.flac.npy"

data=np.load(path)

print(data.shape)